import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Register from '../views/Register.vue'
import Detail from '../views/Detail.vue'
import Layout from '../views/Layout.vue'
//二级路由
import Like from '../views/Erji/Like.vue'
import Article from '../views/Erji/Article.vue'
import Collect from '../views/Erji/Collect.vue'
import My from '../views/Erji/My.vue'
Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    { path: '/Login', name:'Login' , component: Login },
    { path: '/register', name:'Register' , component: Register },
    { path: '/article/:id', name:'Detail' , component: Detail },
    {
      path: '/',
      component: Layout,
      redirect: '/article',
      children: [
        { path: '/article', name:'Article' , component: Article },
        { path: '/like', name:'Like' , component: Like },
        { path: '/collect', name:'Collect' , component: Collect },
        { path: '/my', name:'My' , component: My }
      ]
    }
  ]
})

export default router